package cn.stalk.wf.dao;

import cn.stalk.wf.entity.Test;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.util.List;

@org.springframework.stereotype.Repository
public interface AccessRepository extends Repository<Test, String> {

    @Query(value = "select id_ from act_id_user", nativeQuery = true)
    List<String> selectAllUser();

    @Query(value = "select distinct user_id_ from act_id_membership where group_id_ = #{group}", nativeQuery = true)
    List<String> selectUserByGroup(@Param("group") String group);

    @Query(value = "select distinct group_id_ from act_id_membership where user_id_ = #{user}", nativeQuery = true)
    List<String> selectGroupByUser(@Param("user") String user);

}
